<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-workin',
    'basePath' => dirname(__DIR__),
	'language' => 'zh-CN',
    'bootstrap' => ['log'],
    'controllerNamespace' => 'workin\controllers',
    'components' => [
        'request' => [
            'csrfParam' => '_csrf-workin',
        ],
        'session' => [
            // this is the name of the session cookie used for login on the workin
            'name' => 'advanced-workin',
	        'timeout' => 3600,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
//            'showScriptName' => false,
            'rules' => [
            ],
        ],
	    'assetManager' => [
		    'converter' =>
		    [
			    'class' => \singrana\assets\Converter::className(),
		    ],
	    ],
        'user' => [
            'class' => \workin\rewrite\web\User::className(),
            'identityClass' => \workin\models\User::className(),
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-workin', 'httpOnly' => true],
            'authTimeout' => 3600,
        ],
    ],
    'modules' => [
        'gridview' => [
            'class' => \kartik\grid\Module::className(),
            // see settings on http://demos.krajee.com/grid#module
        ],
        'datecontrol' => [
            'class' => \kartik\datecontrol\Module::className(),
            // see settings on http://demos.krajee.com/datecontrol#module
        ],
        // If you use tree table
        'treemanager' =>  [
            'class' => \kartik\tree\Module::className(),
            // see settings on http://demos.krajee.com/tree-manager#module
        ],
        'dynagrid'=>[
            'class'=>\kartik\dynagrid\Module::className(),
            // other settings (refer documentation)
        ],
	    'test' => [
		    'class' => 'workin\modules\test\TestModule',
	    ],
        'increment' => [
            'class' => \workin\modules\increment\IncrementModule::className(),
        ],
        'others' => [
            'class' => \workin\modules\others\OthersModule::className(),
        ],
    ],
    'as access' => [
        'class' => \workin\behaviors\Access::className(),
        'except' => [
            'site/*',
            'gii/*',
            'debug/*',
            'increment/default/*',
            'others/*',
        ],
        'rules' => [
            [
                'allow' => true,
                'roles' => ['@'],
            ],
        ],
    ],
    'params' => $params,
];
